﻿using System.IO;

namespace CommonLibraries.DeviceLibrary.Helpers
{
    public static class ErrorManager
    {
        public static void CreateDebug(string debugText)
        {
            StreamWriter _a = File.AppendText(".\\DebugClasses.txt");
            _a.WriteLine("##############################");
            _a.WriteLine(System.DateTime.Now.ToShortDateString() + " " + System.DateTime.Now.ToShortTimeString());
            _a.WriteLine("##############################");
            _a.WriteLine(debugText);
            _a.Close();
            _a.Dispose();

        }

        public static void CreateDebug(string fileName, string cadena)
        {
            StreamWriter _a = File.AppendText(".\\" + fileName);
            
            _a.WriteLine("##############################");
            _a.WriteLine(System.DateTime.Now.ToShortDateString() + " " + System.DateTime.Now.ToLongTimeString());
            _a.WriteLine(cadena);
            _a.WriteLine("##############################");
            _a.Close();
            _a.Dispose();
        }
    }
}
